import i18n from "i18next";
import enUsTrans from "./modules/en";
import zhCnTrans from "./modules/zh";
import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';

i18n.use(initReactI18next).init({
  resources: {
    enUS: {
      translation: enUsTrans,
    },
    zhCN: {
      translation: zhCnTrans,
    },
  },
  // 默认语言
  fallbackLng: "zhCN",
  debug: false,
  interpolation: {
    escapeValue: false,
  }
})
i18n.use(LanguageDetector)

export default i18n